<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link href="assets/css/site.css" rel="stylesheet" type="text/css" />
    <link href="assets/css/reg.css" rel="stylesheet" type="text/css" />
    <link href="assets/plugins/fa/css/font-awesome.css" rel="stylesheet" type="text/css" />
    <script src="assets/jquery2.js"></script>
    <script>
        function checkPWD(){
            let pwd1 = document.getElementById("pwd1").value;
            let pwd2 = document.getElementById("pwd2").value;
            //正则表达式判断
            var pattern =/1/;
            let phone =  document.getElementById("phoneNum").value;
            console.log(phone);
            if(!pattern.test(phone)){
                alert("输入的账号不符合要求！");
            }
            console.log(pwd1,pwd2);
            if(pwd1!=pwd2){
                alert("两次输入的密码不一致！");
                return false;
            }
        }
    </script>
</head>
<body>
    <div class="container">
        <div class="title">
            用户注册 
            <img src="assets/imgs/into.png" />
        </div>
        <div class="main">
            <form onsubmit="return checkPWD()" method="get">
                <div class="formItem">
                    <input id="phoneNum" type="text" placeholder="请输入账号（手机）" required   />
                    <div class="icon">
                        <i class="fa fa-user"></i>
                    </div>
                </div>
                <div class="formItem">
                    <input id="pwd1" type="password" placeholder="请输入密码" required />
                    <div class="icon iconPWD"></div>
                </div>
                <div class="formItem">
                    <input id="pwd2" type="password" placeholder="请再次输入密码" required />
                    <div class="icon iconPWD"></div>
                </div>
                <div class="formItem">
                    <input type="text" placeholder="请输入站内昵称" required />
                    <div class="icon iconUser"></div>
                </div>
                <div class="btnItem">
                    <button><i class="fa fa-user-plus"></i> 确认注册</button>
                    <a href="forgetPwd.html" class="linkReg">忘记密码？</a>
                </div>
            </form>
        </div>
    </div>
</body>
</html>